package training.designpatterns;

import java.util.ArrayList;
import java.util.List;

public class SubjectImpl implements Subject {
	
	List<Observer> observers = new ArrayList<Observer>();

	@Override
	public void addObserver(Observer observer) {
		observers.add(observer);

	}

	@Override
	public void removeObserver(Observer observer) {
	
		observers.remove(observer);

	}

	@Override
	public void notifyObservers() {
		
		for (Observer observer : observers) {
			observer.doAction("Dummy event happened");
		}

	}

}
